// ==UserScript==
// @match http://xkcd.com/*
// ==/UserScript==

(function () {
	var elements = document.getElementsByClassName("s");
	for (var i in elements) {
		var imgs = elements[i].getElementsByTagName("img");
		if (imgs.length == 1) {
			var img = imgs[0];

			var ndiv = document.createElement("div");
			ndiv.style.fontVariant = "normal";
			ndiv.style.border = "1px solid rgb(155, 155, 35)";
			ndiv.style.backgroundColor = "rgb(255, 255, 235)";
			ndiv.style.MozBorderRadius = "8px";
			ndiv.appendChild(document.createTextNode(img.title));
			img.parentNode.insertBefore(ndiv, img.nextSibling);
		}
	}
})()
